<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>城市信息管理管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(document).ready(function () {
            //$("#name").focus();
            $("#inputForm").validate({
                submitHandler: function (form) {
                    loading('正在提交，请稍等...');
                    form.submit();
                },
                errorContainer: "#messageBox",
                errorPlacement: function (error, element) {
                    $("#messageBox").text("输入有误，请先更正。");
                    if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
                        error.appendTo(element.parent().parent());
                    } else {
                        error.insertAfter(element);
                    }
                }
            });
        });
        function  Play(obj) {
            vid = $("#"+obj).val();
            window.open("${ctx}/adv/hkMediaAdv/mediaPlayPath?videoId=" + vid);
        }

    </script>
</head>
<body>
<ul class="nav nav-tabs">
    <li><a href="${ctx}/sys/adv/hkCityInfo/">城市信息管理列表</a></li>
    <li class="active"><a href="${ctx}/sys/adv/hkCityInfo/form?id=${hkCityInfo.id}">城市信息管理<shiro:hasPermission
            name="sys:adv:hkCityInfo:edit">${not empty hkCityInfo.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission
            name="sys:adv:hkCityInfo:edit">查看</shiro:lacksPermission></a></li>
</ul>
<br/>
<form:form id="inputForm" modelAttribute="hkCityInfo" action="${ctx}/sys/adv/hkCityInfo/save" method="post"
           class="form-horizontal">
    <form:hidden path="id"/>
    <sys:message content="${message}"/>
    <div class="control-group">
        <label class="control-label">国家：</label>
        <div class="controls">
            <sys:treeselect id="country" name="country.id" value="${hkCityInfo.country.id}" labelName="country.name"
                            labelValue="${hkCityInfo.country.name}"
                            title="区域" url="/sys/area/treeData" cssClass="" allowClear="true"
                            notAllowSelectParent="false" allowInput="true"/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">省：</label>
        <div class="controls">
            <sys:treeselect id="province" name="province.id" value="${hkCityInfo.province.id}" labelName="province.name"
                            labelValue="${hkCityInfo.province.name}"
                            title="区域" url="/sys/area/treeData" cssClass="" allowClear="true"
                            notAllowSelectParent="false" allowInput="true"/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">市：</label>
        <div class="controls">
            <sys:treeselect id="city" name="city.id" value="${hkCityInfo.city.id}" labelName="city.name"
                            labelValue="${hkCityInfo.city.name}"
                            title="区域" url="/sys/area/treeData" cssClass="" allowClear="true"
                            notAllowSelectParent="false" allowInput="true"/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">图片：</label>
        <div class="controls">
            <form:hidden id="imgSrc" path="imgSrc" htmlEscape="false" maxlength="200" class="input-xlarge"/>
            <sys:ckfinder input="imgSrc" type="images" uploadPath="/sys/hkCityInfo" selectMultiple="false"/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">官方视频：</label>
        <div class="controls">
            <form:input id="officialVideo" path="officialVideo" htmlEscape="false"   maxlength="200" class="input-xlarge"/>
            <a href="javascript:" onclick="Play('officialVideo')" class="btn">播放</a>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">官方视频：</label>
        <div class="controls">
            <form:hidden id="aofficialVideo" path="aofficialVideo" htmlEscape="false" maxlength="200"
                         class="input-xlarge"/>
            <sys:ckfinder input="aofficialVideo" type="files" uploadPath="/sys/adv/hkCityInfo" selectMultiple="false"/>

        </div>
    </div>
    <div class="control-group">
        <label class="control-label">官方视频封面：</label>
        <div class="controls">
            <form:hidden id="officialCoverImgSrc" path="officialCoverImgSrc" htmlEscape="false" maxlength="200"
                         class="input-xlarge"/>
            <sys:ckfinder input="officialCoverImgSrc" type="images" uploadPath="/sys/hkCityInfo"
                          selectMultiple="false"/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">传统视频：</label>
        <div class="controls">
            <form:input id="traditionalVideo" path="traditionalVideo" htmlEscape="false"   maxlength="200" class="input-xlarge"/>
            <a href="javascript:" onclick="Play('traditionalVideo')" class="btn">播放</a>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">传统视频：</label>
        <div class="controls">
            <form:hidden id="atraditionalVideo" path="atraditionalVideo" htmlEscape="false" maxlength="200"
                         class="input-xlarge"/>
            <sys:ckfinder input="atraditionalVideo" type="files" uploadPath="/sys/adv/hkCityInfo"
                          selectMultiple="false"/>

        </div>
    </div>
    <div class="control-group">
        <label class="control-label">简介：</label>
        <div class="controls">

            <form:textarea id="info" path="info" htmlEscape="true" class="input-xxlarge"/>
            <sys:ckeditor replace="info" uploadPath="/sys/adv/hkCityInfo"/>

        </div>
    </div>
    <div class="control-group">
        <label class="control-label">传统视频封面：</label>
        <div class="controls">
            <form:hidden id="traditionalCoverImgSrc" path="traditionalCoverImgSrc" htmlEscape="false" maxlength="200"
                         class="input-xlarge"/>
            <sys:ckfinder input="traditionalCoverImgSrc" type="images" uploadPath="/sys/hkCityInfo"
                          selectMultiple="false"/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">备注：</label>
        <div class="controls">
            <form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="100" class="input-xxlarge "/>
        </div>
    </div>
    <div class="form-actions">
        <shiro:hasPermission name="sys:adv:hkCityInfo:edit"><input id="btnSubmit" class="btn btn-primary" type="submit"
                                                                   value="保 存"/>&nbsp;</shiro:hasPermission>
        <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
    </div>
</form:form>
</body>
</html>